/**
 * 
 */
package org.jft.datamodel.database.dao;

import org.jft.datamodel.database.dao.implementation.EventClassDAO;
import org.jft.datamodel.database.dao.implementation.ParentsDAO;
import org.jft.datamodel.database.dao.implementation.PersonDAO;

/**
 * @author LAP
 *
 */
public class DAOFactory {
	
	private static EventClassDAO eventClassDAO = null;
	private static PersonDAO personDAO = null;
	private static ParentsDAO parentsDAO = null;
	
	private static class DAOFactoryKeeper {
		private static DAOFactory INSTANCE = new DAOFactory();
	}
	
	public static DAOFactory getinstance() {
		return DAOFactoryKeeper.INSTANCE;
	}
	
	public EventClassDAO getEventClassDAO() {
		if(eventClassDAO == null) {
			eventClassDAO = new EventClassDAO();
		}
		return eventClassDAO;
	}
	
	public PersonDAO getPersonDAO() {
		if(personDAO == null) {
			personDAO = new PersonDAO();
		}
		return personDAO;
	}
	
	public ParentsDAO getParentsDAO() {
		if(parentsDAO == null) {
			parentsDAO = new ParentsDAO();
		}
		return parentsDAO;
	}
	
}
